package com.platform.system.service.impl;

import java.util.List;

import com.platform.common.annotation.DataScope;
import com.platform.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.platform.system.mapper.ProFeedbackMapper;
import com.platform.system.domain.ProFeedback;
import com.platform.system.service.IProFeedbackService;

/**
 * 反馈Service业务层处理
 *
 * @author platform
 * @date 2025-02-23
 */
@Service
public class ProFeedbackServiceImpl implements IProFeedbackService {
    @Autowired
    private ProFeedbackMapper proFeedbackMapper;

    /**
     * 查询反馈
     *
     * @param id 反馈主键
     * @return 反馈
     */
    @Override
    public ProFeedback selectProFeedbackById(Long id) {
        return proFeedbackMapper.selectProFeedbackById(id);
    }

    /**
     * 查询反馈列表
     *
     * @param proFeedback 反馈
     * @return 反馈
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<ProFeedback> selectProFeedbackList(ProFeedback proFeedback) {
        return proFeedbackMapper.selectProFeedbackList(proFeedback);
    }

    /**
     * 查询反馈列表
     *
     * @param proFeedback 反馈
     * @return 反馈
     */
    @Override
    public List<ProFeedback> selectProFeedbackListAll(ProFeedback proFeedback) {
        return proFeedbackMapper.selectProFeedbackListAll(proFeedback);
    }

    /**
     * 新增反馈
     *
     * @param proFeedback 反馈
     * @return 结果
     */
    @Override
    public int insertProFeedback(ProFeedback proFeedback) {
        proFeedback.setCreateTime(DateUtils.getNowDate());
        return proFeedbackMapper.insertProFeedback(proFeedback);
    }

    /**
     * 修改反馈
     *
     * @param proFeedback 反馈
     * @return 结果
     */
    @Override
    public int updateProFeedback(ProFeedback proFeedback) {
        proFeedback.setUpdateTime(DateUtils.getNowDate());
        return proFeedbackMapper.updateProFeedback(proFeedback);
    }

    /**
     * 批量删除反馈
     *
     * @param ids 需要删除的反馈主键
     * @return 结果
     */
    @Override
    public int deleteProFeedbackByIds(Long[] ids) {
        return proFeedbackMapper.deleteProFeedbackByIds(ids);
    }

    /**
     * 删除反馈信息
     *
     * @param id 反馈主键
     * @return 结果
     */
    @Override
    public int deleteProFeedbackById(Long id) {
        return proFeedbackMapper.deleteProFeedbackById(id);
    }
}
